//
//  ViewController.m
//  控制器View操作
//
//  Created by MyMac on 15/9/16.
//  Copyright (c) 2015年 tongfang. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property(nonatomic,strong)UITabBarController*tabBar;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor yellowColor];
    self.tabBar=[[UITabBarController alloc]init];
    _tabBar.view.backgroundColor=[UIColor redColor];
    UIPanGestureRecognizer*pan=[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(pan:)];
    [_tabBar.view addGestureRecognizer:pan];
    [self.view addSubview:_tabBar.view];
    // Do any additional setup after loading the view, typically from a nib.
}
-(void)pan:(UIPanGestureRecognizer*)p
{
    self.tabBar.view.frame=CGRectMake([p locationInView:self.tabBar.view].x, 0, self.tabBar.view.bounds.size.width, self.tabBar.view.bounds.size.height);


}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
